<form action="<%= tabs_competition_path(@competition, 'topics') %>" method="get" id="form_ltcfilter">
  <%= hidden_field_tag :tag_id, params[:tag_id] %>
</form>
<div class="frame bar">
  <div class="area">
    <ul class="inline-list left">
      <li><%= topic_tag_entry '全部', '' %></li>
    <% Tag.each do |tag| %>
      <li><%= topic_tag_entry tag.name, tag.id.to_s %></li>
    <% end %>
    </ul>
    <a class="button primary right" style="position:relative;top:-5px"
      href="<%= tabs_competition_path @competition, 'topics', act: '' %>">
      新主题
    </a>
  </div>
</div>
<div id="div_lt" class="bar">
  <% if topic_scope_display.empty? || params[:act] == '' %>
    <%= render partial: 'topics/create',
          locals: { competition: @competition } %>
  <% else %>
    <ul class="list-group">
      
      <% topic_scope_display.each do |topic| %>
        <li class="list-group-item">
          <div class="left">
            <h4 class="" style="width:320px">
              <%= link_to topic.title, topic %>
            </h4>
            <p class="list-group-item-meta left" style="position:absolute">
              <%= topic.remarks.count > 1 ? "#{topic.remarks.count-1}条回复" : '暂无回复' %>
            </p>
          </div>
          <span class="list-group-item-meta left" style="width:180px;">
            <%= author_name(topic) %><br/>
            <%= date_text(topic.created_at) %>
          </span>
          <span class="list-group-item-meta left" style="width:180px;">
            <%= author_name(topic.last_remark) %><br/>
            <%= date_text(topic.last_remark.created_at) %>
          </span>
          <div class="clear"></div>
        </li>
      <% end %>
    </ul>
  <% end %>
  <!--
    new topic
  -->
  <%# js_tag '新主题', { switch: 'form_tnc' } %>
    <%# render partial: 'topics/create',
        locals: { competition: @competition } %>
</div>